package com.cqut.entity;


import java.util.Set;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

//import org.hibernate.annotations.Entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;


/**
 * ArticleType entity. 收件箱实体
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
public class MessageInbox {
	
	@Id
	@GeneratedValue
	private long id;// 收件箱ID
	
	@OneToMany(cascade=CascadeType.ALL,mappedBy="id")
	@JoinColumn(name="messag")
	private Set<Message> messageID;// 留言ID
	
    @OneToOne(fetch=FetchType.LAZY,cascade=CascadeType.ALL)
	@JoinColumn(name="employeeID",unique=true)
	private Employee employeeID;// 所属人员ID
	
	@Column(length=2)
	private int state;// 留言状态 0:未读 1：已读 2:删除

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}
	
	public Set<Message> getMessageID() {
		return messageID;
	}
	
	public void setMessageID(Set<Message> messageID) {
		this.messageID = messageID;
	}

	

	public Employee getEmployeeID() {
		return employeeID;
	}

	public void setEmployeeID(Employee employeeID) {
		this.employeeID = employeeID;
	}

	public int isState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}
}
